<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Logagent: src/logagent-plugin.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Logagent
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">logagent-plugin.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="logagent-plugin_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2018 Steven Lee &lt;geekerlw@gmail.com&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to deal</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * in the Software without restriction, including without limitation the rights</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * copies or substantial portions of the Software.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#ifndef __LOGAGENT_PLUGIN_H__</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#define __LOGAGENT_PLUGIN_H__</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="logagent-plugin_8h.html#a31c206e0aa4c218b9d0bb1eeb6fb52b0">   18</a></span>&#160;<span class="preprocessor">#define PLUGIN_JSON_SIZE        1024</span></div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="logagent-plugin_8h.html#a59c9b236d2de4889b16bf6ca6daf926d">   19</a></span>&#160;<span class="preprocessor">#define PLUGIN_LIB_PATH_SIZE    256</span></div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="logagent-plugin_8h.html#a49b112d25104a8dfcde5d443b599ba11">   20</a></span>&#160;<span class="preprocessor">#define PLUGIN_LIB_NAME_SIZE    64</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="structplugin__t.html">   22</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="structplugin__t.html#a2344de6cd9f0628e66fbbfb5d46fd344">   23</a></span>&#160;    <span class="keywordtype">char</span> json[<a class="code" href="logagent-plugin_8h.html#a31c206e0aa4c218b9d0bb1eeb6fb52b0">PLUGIN_JSON_SIZE</a>]; </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="structplugin__t.html#a50d39f08f9db2a2a7d07bf0c156f7be8">   24</a></span>&#160;    <span class="keywordtype">char</span> path[<a class="code" href="logagent-plugin_8h.html#a59c9b236d2de4889b16bf6ca6daf926d">PLUGIN_LIB_PATH_SIZE</a>]; </div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="structplugin__t.html#ae981388ef9d005eeddfa9b192e5e6ac0">   25</a></span>&#160;    <span class="keywordtype">char</span> name[<a class="code" href="logagent-plugin_8h.html#a49b112d25104a8dfcde5d443b599ba11">PLUGIN_LIB_NAME_SIZE</a>]; </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structplugin__t.html#a3b00bb35a8ec1f7c00baea3092f4643b">   27</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structplugin__t.html#a3b00bb35a8ec1f7c00baea3092f4643b">config</a>;       </div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="comment">/* plugin functions */</span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structplugin__t.html#a29c3d1dd593fd3b16816260701a8f8d0">   30</a></span>&#160;    int (*env_init) (<span class="keywordtype">void</span> **context);</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="structplugin__t.html#a493c286b4a1c1f65f6dbeb8e2d3b1a95">   31</a></span>&#160;    int (*init) (<span class="keywordtype">void</span> *gconfig, <span class="keywordtype">void</span> **context);</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="structplugin__t.html#a5f1f07ba507cee308e78a95e1e93055b">   32</a></span>&#160;    int (*work) (<span class="keywordtype">void</span> *gconfig, <span class="keywordtype">void</span> *pconfig, <span class="keyword">struct </span><a class="code" href="structlist__head.html">list_head</a> * log_list);</div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="structplugin__t.html#a412257b1bd8f06efeb48b133da5368c1">   33</a></span>&#160;    int (*exit) (<span class="keywordtype">void</span> *gconfig, <span class="keywordtype">void</span> **context);</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structplugin__t.html#a8164156742707d40aafdc45333aee4cc">   34</a></span>&#160;    int (*env_destroy) (<span class="keywordtype">void</span> **context);</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structplugin__t.html#a36f7dc7ef661b2947f269b22331bad4f">   36</a></span>&#160;    <span class="keywordtype">void</span> **<a class="code" href="structplugin__t.html#a36f7dc7ef661b2947f269b22331bad4f">context</a>; </div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structplugin__t.html#aa3286d28dbbdbc1781cdc2f67eeef553">   38</a></span>&#160;    <span class="keywordtype">void</span> *<a class="code" href="structplugin__t.html#aa3286d28dbbdbc1781cdc2f67eeef553">lib_handle</a>;   </div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structplugin__t.html#a1f00f18b91d5a820f2c43064243aa86e">   40</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structlist__head.html">list_head</a> list;  </div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;} <a class="code" href="structplugin__t.html">plugin_t</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keywordtype">void</span> <a class="code" href="logagent-plugin_8h.html#aa5b37c39a9b50a7bb0a9a79d5080f871">logagent_plugin_env_init_all</a>(<span class="keyword">struct</span> <a class="code" href="structlist__head.html">list_head</a> *plugin_list);</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keywordtype">void</span> <a class="code" href="logagent-plugin_8h.html#ab8d1a96c9c8ac1d7059da7e979d7297d">logagent_plugin_env_destroy_all</a>(<span class="keyword">struct</span> <a class="code" href="structlist__head.html">list_head</a> *plugin_list);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keywordtype">void</span> <a class="code" href="logagent-plugin_8h.html#a8d88a7cd01f6d950ec032a16d4d9951a">logagent_plugin_config_load</a>(<span class="keyword">struct</span> <a class="code" href="structlist__head.html">list_head</a> *plugin_list,</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;                 <span class="keyword">const</span> <span class="keywordtype">char</span> *json);</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keywordtype">void</span> <a class="code" href="logagent-plugin_8h.html#a29da9290f7f4219121a6706106a83a27">logagent_plugin_config_unload</a>(<span class="keyword">struct</span> <a class="code" href="structlist__head.html">list_head</a> *plugin_list);</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="logagent-plugin_8h_html_a59c9b236d2de4889b16bf6ca6daf926d"><div class="ttname"><a href="logagent-plugin_8h.html#a59c9b236d2de4889b16bf6ca6daf926d">PLUGIN_LIB_PATH_SIZE</a></div><div class="ttdeci">#define PLUGIN_LIB_PATH_SIZE</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:19</div></div>
<div class="ttc" id="structplugin__t_html_a36f7dc7ef661b2947f269b22331bad4f"><div class="ttname"><a href="structplugin__t.html#a36f7dc7ef661b2947f269b22331bad4f">plugin_t::context</a></div><div class="ttdeci">void ** context</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:36</div></div>
<div class="ttc" id="structplugin__t_html"><div class="ttname"><a href="structplugin__t.html">plugin_t</a></div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:22</div></div>
<div class="ttc" id="structlist__head_html"><div class="ttname"><a href="structlist__head.html">list_head</a></div><div class="ttdef"><b>Definition:</b> logagent-list.h:26</div></div>
<div class="ttc" id="logagent-plugin_8h_html_a29da9290f7f4219121a6706106a83a27"><div class="ttname"><a href="logagent-plugin_8h.html#a29da9290f7f4219121a6706106a83a27">logagent_plugin_config_unload</a></div><div class="ttdeci">void logagent_plugin_config_unload(struct list_head *plugin_list)</div></div>
<div class="ttc" id="logagent-plugin_8h_html_a31c206e0aa4c218b9d0bb1eeb6fb52b0"><div class="ttname"><a href="logagent-plugin_8h.html#a31c206e0aa4c218b9d0bb1eeb6fb52b0">PLUGIN_JSON_SIZE</a></div><div class="ttdeci">#define PLUGIN_JSON_SIZE</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:18</div></div>
<div class="ttc" id="logagent-plugin_8h_html_aa5b37c39a9b50a7bb0a9a79d5080f871"><div class="ttname"><a href="logagent-plugin_8h.html#aa5b37c39a9b50a7bb0a9a79d5080f871">logagent_plugin_env_init_all</a></div><div class="ttdeci">void logagent_plugin_env_init_all(struct list_head *plugin_list)</div></div>
<div class="ttc" id="logagent-plugin_8h_html_a8d88a7cd01f6d950ec032a16d4d9951a"><div class="ttname"><a href="logagent-plugin_8h.html#a8d88a7cd01f6d950ec032a16d4d9951a">logagent_plugin_config_load</a></div><div class="ttdeci">void logagent_plugin_config_load(struct list_head *plugin_list, const char *json)</div></div>
<div class="ttc" id="structplugin__t_html_aa3286d28dbbdbc1781cdc2f67eeef553"><div class="ttname"><a href="structplugin__t.html#aa3286d28dbbdbc1781cdc2f67eeef553">plugin_t::lib_handle</a></div><div class="ttdeci">void * lib_handle</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:38</div></div>
<div class="ttc" id="structplugin__t_html_a3b00bb35a8ec1f7c00baea3092f4643b"><div class="ttname"><a href="structplugin__t.html#a3b00bb35a8ec1f7c00baea3092f4643b">plugin_t::config</a></div><div class="ttdeci">void * config</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:27</div></div>
<div class="ttc" id="logagent-plugin_8h_html_ab8d1a96c9c8ac1d7059da7e979d7297d"><div class="ttname"><a href="logagent-plugin_8h.html#ab8d1a96c9c8ac1d7059da7e979d7297d">logagent_plugin_env_destroy_all</a></div><div class="ttdeci">void logagent_plugin_env_destroy_all(struct list_head *plugin_list)</div></div>
<div class="ttc" id="logagent-plugin_8h_html_a49b112d25104a8dfcde5d443b599ba11"><div class="ttname"><a href="logagent-plugin_8h.html#a49b112d25104a8dfcde5d443b599ba11">PLUGIN_LIB_NAME_SIZE</a></div><div class="ttdeci">#define PLUGIN_LIB_NAME_SIZE</div><div class="ttdef"><b>Definition:</b> logagent-plugin.h:20</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
